<%@ page language="java" contentType="text/html; charset=UTF-8"
	pageEncoding="UTF-8"%>
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<title>盘点管理</title>
</head>
<body>
	<script type="text/javascript">
		$(function() {
			
			//盘点
			$('#takestock-dg').datagrid({
				url : 'find-checktable',
				pagination : true,
				singleSelect: true,
				pageNumber : 1,
				pageSize : 3,
				pageList : [ 3, 6 ],
				columns : [ [
					{field : 'drugchek_id',						title : '盘点单号',		width : 260},
					{field : 'drugchek_category',				title : '盘点库房',		width : 260},
					{field : 'drugchek_people',					title : '填制人',			width : 265},
					{field : 'drugchek_time',					title : '盘点时间',		width : 262,formatter:comFormatDate},
					{field : 'drugchek_allmoney',				title : '盘点金额',		width : 110,hidden:true},
					{field : 'drugcheck_differencemoney',		title : '金额差',			width : 110,hidden:true},
					{field : 'drugchek_allnumber',				title : '总数量',			width : 217,hidden:true},
					{field : 'drugcheck_state',					title : '数量差',			width : 217,hidden:true}
				] ],
				onDblClickRow : function(rowIndex, rowData) {
					$("#takestock-win").window("open");
					//给盘点单号赋值
				    $("#take-no").textbox('setValue',rowData.drugchek_id);
				  	//给盘点库房赋值
				    $("#take-type").textbox('setValue',rowData.drugchek_category);	
				 	//给填制人赋值
				    $("#take-tzr").textbox('setValue',rowData.drugchek_people);
				  	//给盘点时间赋值
				  	var s=rowData.drugchek_time;
					var t=CurentTime(s);
					//给盘点时间赋值
				    $("#take-date").textbox('setValue',t);
				  	//给盘点填制日期赋值
				    $("#take-tzrq").textbox('setValue',t);
				 	//给盘点总金额赋值
				    $("#take-pdje").textbox('setValue',rowData.drugchek_allmoney);
				 	//给盘点金额差赋值
				    $("#take-jec").textbox('setValue',0);
				  	//给盘点总数量赋值
				    $("#take-pdzsl").textbox('setValue',rowData.drugchek_allnumber);
				  	//给盘点数量差赋值
				    $("#take-pdslc").textbox('setValue',rowData.drugcheck_state);
					
				  	
				  	//获取盘点单号
				    var drugchekid = $("#take-no").textbox("getValue");
				  	
				  	//根据盘点单号获取
					$.ajax({  
                        url: 'find-checkdetails',  
                        data:{'drugchekid' :drugchekid},
                        type: 'POST',  
                        dataType:"json",
					 	success: function (data) {  
				 				//遍历数据前清空datagrid数据
				 				$('#takestocktbxq-dg').datagrid('loadData',{total:0,rows:[]});
				 				//循环订单商品数据
				                for ( var machine in data.result) {
				                    var row_data = {
				                    	'inventory_number': data.result[machine].inventory_number,
				                    	'drugchekdetails_id' : data.result[machine].drugchekdetails_id,
				    					'drug_number' : data.result[machine].drug_number,
				                        'drug_name' : data.result[machine].drug_name,
				                        'drug_standard' : data.result[machine].drug_standard,
				                        'drug_unit' : data.result[machine].drug_unit,		
				                        'drugchekdetails_pici' : data.result[machine].drugchekdetails_pici,	
				                        'inventory_details_batch' : data.result[machine].inventory_details_batch,
				                        'drugchekdetails_book' : data.result[machine].drugchekdetails_book,
				                        'drugchekdetails_shijinumber' : data.result[machine].drugchekdetails_book,
				                        'drugchekdetails_sort' : data.result[machine].drugchekdetails_sort,
				                        'drugchekdetails_shuliangcha' : data.result[machine].drugchekdetails_shuliangcha,
				                        'drugchekdetails_slc' : data.result[machine].drugchekdetails_shuliangcha,
				                        'drug_purchase_price' : data.result[machine].drug_purchase_price,
				                        'drug_retail_price' : data.result[machine].drug_retail_price,
				                        'supplier_name' : data.result[machine].supplier_name,
				                        'drugruku' : data.result[machine].drugruku,
				                        'drugchuku' : data.result[machine].drugchuku,
				                        'drugtuiyao' : data.result[machine].drugtuiyao,
				                        'drugxiaohui' : data.result[machine].drugxiaohui
				                    };
				                    $('#takestocktbxq-dg').datagrid('appendRow', row_data);
				                }
					     }, 				     
                        Error: function () {  
                            alert(Error);  
                        }                   
                    });    
					
				}
			});

			//盘点记录
			$('#takestockjl-dg').datagrid({
				url : 'find-drugcheck',
				pagination : true,
				singleSelect: true,
				pageNumber : 1,
				pageSize : 3,
				pageList : [ 3, 6 ],
				columns : [ [
					{field : 'drugchek_id',						title : '盘点单号',		width : 150},
					{field : 'drugchek_category',				title : '盘点库房',		width : 130},
					{field : 'drugchek_people',					title : '填制人',			width : 115},
					{field : 'drugchek_time',					title : '盘点时间',		width : 150,formatter:comFormatDate},
					{field : 'drugcheck_twopeople',				title : '审核人',			width : 125},
					{field : 'drugcheck_endtime',				title : '审核时间',		width : 150,formatter:comFormatDate},
					{field : 'drugchek_allmoney',				title : '盘点金额',		width : 120,hidden:true},
					{field : 'drugcheck_differencemoney',		title : '金额差',			width : 110,hidden:true},
					{field : 'drugchek_zhaiyao',				title : '摘要（M）',		width : 227},
					{field : 'drugchek_allnumber',				title : '总数量',			width : 217,hidden:true},
					{field : 'drugcheck_state',					itle : '数量差',			width : 217,hidden:true}
				] ],
				onDblClickRow : function(rowIndex, rowData) {
					$("#takestocktbjl-win").window("open");
					
					//给盘点单号赋值
				    $("#take-nos").textbox('setValue',rowData.drugchek_id);
				  	//给盘点库房赋值
				    $("#take-types").textbox('setValue',rowData.drugchek_category);
				 	//给盘点时间赋值
				 	var ss=rowData.drugchek_time;
					var tt=CurentTime(ss);
				    $("#take-dates").textbox('setValue',tt);
				  	//给金额差赋值
				    $("#take-jecs").textbox('setValue',rowData.drugcheck_differencemoney);
				  	//给总金额赋值
				    $("#take-zjes").textbox('setValue',rowData.drugchek_allmoney);
				  	//给摘要赋值
				    $("#take-zys").textbox('setValue',rowData.drugchek_zhaiyao);
				  	//给填制人赋值
				    $("#take-tzrs").textbox('setValue',rowData.drugchek_people);
				  	//给盘点时间赋值
				    $("#take-pdsjs").textbox('setValue',tt);
				  	//给审核人赋值
				    $("#take-shrs").textbox('setValue',rowData.drugcheck_twopeople);
				  	//给审核时间赋值
				  	var st=rowData.drugcheck_endtime;
					var ts=CurentTime(st);
				    $("#take-shsjs").textbox('setValue',ts);
				 	 //给总数量赋值
				    $("#take-zsl").textbox('setValue',rowData.drugchek_allnumber);
				    //给总数量差赋值
				    $("#take-slcs").textbox('setValue',rowData.drugcheck_state);
				 	 
				 	//获取盘点单号
				    var drugchekid = $("#take-nos").textbox("getValue");
				  	
				  	//根据盘点单号获取
					$.ajax({  
                        url: 'find-checkdetails',  
                        data:{'drugchekid' :drugchekid},
                        type: 'POST',  
                        dataType:"json",
					 	success: function (data) {  
				 				//遍历数据前清空datagrid数据
				 				$('#takestocktb-dg').datagrid('loadData',{total:0,rows:[]});
				 				//循环订单商品数据
				                for ( var machine in data.result) {
				                    var row_data = {
				                    		'inventory_number': data.result[machine].inventory_number,
				                    		'drug_number' : data.result[machine].drug_number,
					                        'drug_name' : data.result[machine].drug_name,
					                        'drug_standard' : data.result[machine].drug_standard,
					                        'drug_unit' : data.result[machine].drug_unit,		
					                        'drugchekdetails_pici' : data.result[machine].drugchekdetails_pici,	
					                        'inventory_details_batch' : data.result[machine].inventory_details_batch,
					                        'drugchekdetails_book' : data.result[machine].drugchekdetails_book,
					                        'drugchekdetails_shijinumber' : data.result[machine].drugchekdetails_shijinumber,
					                        'drugchekdetails_sort' : data.result[machine].drugchekdetails_sort,
					                        'drugchekdetails_shuliangcha' : data.result[machine].drugchekdetails_shuliangcha,
					                        'drugchekdetails_slc' : data.result[machine].drugchekdetails_shuliangcha,
					                        'drug_purchase_price' : data.result[machine].drug_purchase_price,
					                        'drug_retail_price' : data.result[machine].drug_retail_price,
					                        'supplier_name' : data.result[machine].supplier_name,
					                        'drugruku' : data.result[machine].drugruku,
					                        'drugchuku' : data.result[machine].drugchuku,
					                        'drugtuiyao' : data.result[machine].drugtuiyao,
					                        'drugxiaohui' : data.result[machine].drugxiaohui
				                    };
				                    $('#takestocktb-dg').datagrid('appendRow', row_data);
				                }
					     }, 				     
                        Error: function () {  
                            alert(Error);  
                        }                   
                    });    
				  	
				}
			});		
			
			//药品盘点记录详情
			$('#takestocktb-dg').datagrid({
				url : '',
				pagination : true,
				pageNumber : 1,
				pageSize : 3,
				singleSelect: true,
				pageList : [ 3, 6 ],
				columns : [ [ 
					{field : 'inventory_number',				title : '库存编号',		width : 123},
					{field : 'drug_number',						title : '药品编号',		width : 123,hidden:true}, 
					{field : 'drug_name',						title : '药品名称',		width : 120}, 
					{field : 'drug_standard',					title : '规格',			width : 100}, 
					{field : 'drug_unit',						title : '单位',			width : 57},
					{field : 'drugchekdetails_pici',			title : '批次',			width : 57},
					{field : 'drugchekdetails_book',			title : '帐面数量',		width : 90}, 
					{field : 'drugchekdetails_shijinumber',		title : '实盘数量',		width : 90}, 
					{field : 'drugchekdetails_sort',			title : '标志',			width : 77,
						formatter : function(value,row,index){	   
		                    if(value=='0'){return '平'}  
		                    else if(value=='1'){return '亏'}
		                    else if(value=='2'){return '盈'}
		             	} 	
					}, 
					{field : 'drugchekdetails_slc',				title : '数量差',			width : 77}, 
					{field : 'drug_purchase_price',				title : '成本价',			width : 66}, 
					{field : 'drug_retail_price',				title : '售价',				width : 66},
					{field : 'supplier_name',					title : '供应商',			width : 90},
					{field : 'drugruku',						title : '入库数量',			width : 77}, 
					{field : 'drugchuku',						title : '出库数量',			width : 66}, 
					{field : 'drugtuiyao',						title : '退药数量',			width : 66},
					{field : 'drugxiaohui',						title : '销毁数量',			width : 90}
				] ]
			});
			
			//药品盘点详情
			$('#takestocktbxq-dg').datagrid({
				url : '',
				pagination : true,
				pageNumber : 1,
				pageSize : 3,
				singleSelect: true,
				pageList : [ 3, 6 ],
				columns : [ [ 
					{field : 'inventory_number',				title : '库存编号',		width : 123},
					{field : 'drugchekdetails_id',				title : '盘点编号',		width : 123,hidden:true},
					{field : 'drug_number',						title : '药品编号',		width : 123,hidden:true}, 
					{field : 'drug_name',						title : '药品名称',		width : 120}, 
					{field : 'drug_standard',					title : '规格',			width : 100}, 
					{field : 'drug_unit',						title : '单位',			width : 57},
					{field : 'drugchekdetails_pici',			title : '批次',			width : 57},
					{field : 'drugchekdetails_book',			title : '帐面数量',		width : 90}, 
					{field : 'drugchekdetails_shijinumber',		title : '实盘数量',		width : 90,editor:'numberbox'}, 
					{field : 'drugchekdetails_sort',			title : '标志',			width : 77,
						formatter : function(value,row,index){	   
		                    if(value=='0'){return '平'}  
		                    else if(value=='1'){return '亏'}
		                    else if(value=='2'){return '盈'}
		             	} 	
					}, 
					{field : 'drugchekdetails_slc',				title : '数量差',		width : 77}, 
					{field : 'drug_purchase_price',				title : '成本价',		width : 66}, 
					{field : 'drug_retail_price',				title : '售价',		width : 66},
					{field : 'supplier_name',					title : '供应商',		width : 90},
					{field : 'drugruku',						title : '入库数量',			width : 77}, 
					{field : 'drugchuku',						title : '出库数量',			width : 66}, 
					{field : 'drugtuiyao',						title : '退药数量',			width : 66},
					{field : 'drugxiaohui',						title : '销毁数量',			width : 90}
				] ]
			});
			
			$("#save-takestocktb").click(function() {
				var kufang = $("#kufang").combobox('getText'); 
				if(kufang=="中药房"){
					var caty = 1;
				}else if(kufang=="西药房"){
					var caty = 2;
				}
				var name = $("#outboundPeople").val();
				$.ajax({  
                    url: 'save-Check',  
                    data:{
                    	'caty':caty,
                    	'name':name
                    },
                    type: 'POST',  
                    dataType:"json",
				 	success: function (data) { 
				 		if(data==3){
				 			$("#DRUGONEe").window("open");
							$(".drugonee").text("本月已盘点，请下个月再盘点");
							setTimeout(function(){
								$("#DRUGONEe").window("close");
								$("#takestock-dg").datagrid("reload");
							},2000);
				 		}
				 		if(data==1){
				 			$("#DRUGONEe").window("open");
							$(".drugonee").text("盘点成功！！！");
							setTimeout(function(){
								$("#DRUGONEe").window("close");
								$("#takestock-dg").datagrid("reload");
							},2000);
				 		}
						
				    }, 				     
                    Error: function () {  
                        alert(Error);  
                    }                   
                });    
			});
			
			$("#save-takestocktbd").click(function(){
				var name = $("#outboundPeople").val();	
				var zhaiyao = $("#take-zy").val();
				var checkid = $("#take-no").val();
				var times = CurentTime();
				var jinec = $("#take-jec").val();
				var sumc = $("#take-pdslc").val();
				
				if(zhaiyao==""){
					$(".drugonee").text("请填写审核摘要！");
				 	$("#DRUGONEe").window('open');
			    	//秒之后自动消失
				   	setTimeout(function(){
						$("#DRUGONEe").window('close');						
					}, 2000);
				}else{
					//获取表格中的详情记录
					var rows = $("#takestocktbxq-dg").datagrid("getRows");
					for (var i = 0; i < rows.length; i++) {
						var invsum = rows[i]["inventory_number"];
						var pici = rows[i]["drugchekdetails_pici"];
						var shul = rows[i]["drugchekdetails_shijinumber"];
						
						var slcha = rows[i]["drugchekdetails_slc"];
						var biaozhi = rows[i]["drugchekdetails_sort"];
						var tid = rows[i]["drugchekdetails_id"];
						
						//修改库存数量
						$.ajax({  
		                       url: 'update-kusum',  
		                       data:{
		                    	   'invsum': invsum,
			                    	'pici' : pici,                   	
			                    	'shul' : shul
		                       },
		                       type: 'POST',  
		                       dataType:"json",
							   success: function (data) {  
							
							   }, 				     
		                       Error: function () {  
		                           alert(Error);  
		                       }                   
		                });   
						
						//盘点实际数量
						$.ajax({  
		                       url: 'update-take',  
		                       data:{
		                    	   'shijisum': shul,
			                    	'slcha' : slcha,                   	
			                    	'biaozhi' : biaozhi,
			                    	'tid' : tid		              
		                       },
		                       type: 'POST',  
		                       dataType:"json",
							   success: function (data) {  
							
							   }, 				     
		                       Error: function () {  
		                           alert(Error);  
		                       }                   
		                });    
					}
					$.ajax({  
	                    url: 'update-drugscheck',  
	                    type: 'POST',  
	                    dataType:"json",
	                    data:{
	                    	'name': name,
	                    	'zhaiyao' : zhaiyao,                   	
	                    	'times' : times,
	                    	'checkid': checkid,
	                    	'jinec' : jinec,
	                    	'sumc' : sumc
	                    },
					 	success: function (data) {  	
					 		if(data==1){
					 			$("#DRUGONEe").window("open");
								$(".drugonee").text("盘点审核成功！！！");
								setTimeout(function(){
									$("#DRUGONEe").window("close");
									$("#takestock-win").window("close");
									$("#takestock-dg").datagrid("reload");
									$("#takestockjl-dg").datagrid("reload");
								},2000);
					 		}
							
					    }, 				     
	                    Error: function () {  
	                        alert(Error);  
	                    }                   
	                });    
				}
				
			});
					
			
			$("#cancel-takestocktb").click(function(){
				$("#takestock-win").window("close");
				$("#take-zy").textbox("clear");
			});
			
			// 时间戳
			function CurentTime(){
		  
		        var now = new Date();
		       
		        var year = now.getFullYear();       //年
		        var month = now.getMonth() + 1;     //月
		        var day = now.getDate();            //日
		       
		        var hh = now.getHours();            //时
		        var mm = now.getMinutes();          //分
				var ss = now.getSeconds();			//秒
		       
		        var clock = year + "-";
		       
		        if(month < 10)
		            clock += "0";
		       
		        clock += month + "-";
		       
		        if(day < 10)
		            clock += "0";
		           
		        clock += day + " ";
		       
		        if(hh < 10)
		            clock += "0";
		           
		        clock += hh + ":";
		        if (mm < 10) clock += '0'; 
		        clock += mm + ":"; 
				
		        if (ss < 10) clock += '0'; 
		        clock += ss; 
		        return(clock); 
			}
			
			// 时间戳
			function comFormatDate(date) {
				var day = new Date(date); 
				var Year = 0; 
				var Month = 0; 
				var Day = 0; 
				var CurrentDate = ""; 
				//初始化时间 
				Year= day.getFullYear();//ie火狐下都可以 
				Month= day.getMonth()+1; 
				Day = day.getDate(); 
				Hour = day.getHours(); 
				 Minute = day.getMinutes(); 
				 Second = day.getSeconds(); 
				CurrentDate += Year + "-"; 
				if (Month >= 10 ) { 
					CurrentDate += Month + "-"; 
				}else { 
					CurrentDate += "0" + Month + "-"; 
				} 
				if (Day >= 10 ) { 
					CurrentDate += Day ; 
				}else { 
					CurrentDate += "0" + Day ; 
				} 
				if(Hour>=10){
					CurrentDate +=" "+Hour;
				}else{
					CurrentDate +=" "+"0"+Hour;
				}
				if(Minute>=10){
					CurrentDate +=":"+Minute;
				}else{
					CurrentDate +=":"+"0"+Minute;
				}
				if(Second>=10){
					CurrentDate +=":"+Second;
				}else{
					CurrentDate +=":"+"0"+Second;
				}
				return CurrentDate; 
			}

		});
		
		$.extend($.fn.datagrid.methods, {
			editCell: function(jq,param){
				return jq.each(function(){
					var opts = $(this).datagrid('options');
					var fields = $(this).datagrid('getColumnFields',true).concat($(this).datagrid('getColumnFields'));
					for(var i=0; i<fields.length; i++){
						var col = $(this).datagrid('getColumnOption', fields[i]);
						col.editor1 = col.editor;
						if (fields[i] != param.field){
							col.editor = null;
						}
					}
					$(this).datagrid('beginEdit', param.index);
					for(var i=0; i<fields.length; i++){
						var col = $(this).datagrid('getColumnOption', fields[i]);
						col.editor = col.editor1;
					}
				});
			}
		});
		
		
		var editIndex = undefined;
		//盘点编辑数量
		$("#takestocktbxq-dg").datagrid({
			 onClickCell:function(index, field,value){
			
				$('#takestocktbxq-dg').datagrid('selectRow',index);
				if (endEditing(index)){
								
					$('#takestocktbxq-dg').datagrid('selectRow', index)
							.datagrid('editCell', {index:index,field:field});
					editIndex = index;
								
				}
			}
		})

		
		function endEditing(index){
			if (editIndex == undefined){return true}
			if ($('#takestocktbxq-dg').datagrid('validateRow', editIndex)){
				$('#takestocktbxq-dg').datagrid('endEdit', editIndex);
				var row=$('#takestocktbxq-dg').datagrid('getSelected');
				var rows=$('#takestocktbxq-dg').datagrid('getRows');
				editIndex = undefined;
				
				var a=row["drugchekdetails_book"];			
				var b=row["drugchekdetails_shijinumber"];
				var c=b-a;
				if(c>0){
					var d = 2;
				}else if(c<0){
					var d = 1;
				}else if(c=0){
					var d = 0;
				}
				
				var total=0;
				var money=0;
				for (var i = 0; i < rows.length; i++) {
					total +=rows[i]["drugchekdetails_slc"];
					money +=(rows[i]["drugchekdetails_slc"]*rows[i]["drug_purchase_price"]);
				}
				//给盘点金额差赋值
			    $("#take-jec").textbox('setValue',money);
			  	//给盘点数量差赋值
			    $("#take-pdslc").textbox('setValue',total);
								
				$("#takestocktbxq-dg").datagrid('updateRow',{
					index: index,
					row: {
						"drugchekdetails_slc":c ,
						"drugchekdetails_sort":d
					}
				});

				return true;
			} else {
				return false;
			}
		}

		
	</script>
	
	<div id="takestock-p" class="easyui-panel"style="width: 100%; height: 100%; padding: 10px; background: #fafafa;"
		data-options="iconCls:'icon-save',closable:true,collapsible:true,minimizable:true,maximizable:true">
	   		 
			<div style="margin-left: 80px;height:30px;margin-right: 30px;margin-top:10px;">
				<select id="kufang" class="easyui-combobox" data-options="label:'类型：' ,panelHeight:'auto'" name="drug-state" style="width: 200px;">
					<option value="AL">中药房</option>
					<option value="AK">西药房</option>
				</select>
										
				<a id="save-takestocktb" class="easyui-linkbutton" style="margin-left:650px;width:100px;">开始盘点</a>
	
			</div>

		<!-- 盘点审核窗口 -->
		<fieldset style="border: 1px solid #A6A6A6; border-radius: 6px; width: 1050px; margin: 0 auto; margin-top: 10px; margin-bottom: 20px;">
			
			<legend style="font-size: 17px">盘点审核</legend>
			
			<table id="takestock-dg" class="logininform-table easyui-datagrid" style="width: 1030; height: 133px"
				data-options="toolbar:'#logininform-tb',fitColumns:false,singleSelect:false">				
			
			</table>
		
		</fieldset>
		
		<!-- 盘点记录窗口 -->
		<fieldset style="border: 1px solid #A6A6A6; border-radius: 6px; width: 1050px; margin: 0 auto; margin-top: 10px; margin-bottom: 20px;">
			
			<legend style="font-size: 17px">盘点记录</legend>
			
			<table id="takestockjl-dg" class="logininform-table easyui-datagrid" style="width: 1030; height: 170px"
				data-options="toolbar:'#logininform-tb',fitColumns:false,singleSelect:false">				
			
			</table>
		
		</fieldset>		

		<!-- 盘点审核窗口 -->
		<div id="takestock-win" class="easyui-window" title="药品盘点表" style="width: 1075px; height: 580px"
			data-options="iconCls:'icon-save',modal:true,closed:true,shadow:true,resizable:false,collapsible:false,minimizable:false,maximizable:false">
			
			<div class="easyui-layout" data-options="fit:true">
				
				<div data-options="region:'center'">
					
					<div style="width: 1040px; height: 120px;">
						
						<h1 style="text-align:center;font-family:华文楷体;font-size : 30px;">第一医院药品盘点表</h1>
						
						<div  style="float:right;margin-right:0px;margin-top:-60px;">
							
							<input id="take-no" class="easyui-textbox" style="width: 200px" data-options="label:'NO.',readonly:true"></input>
							
							<br><br>
							
							<input id="take-date" class="easyui-textbox" style="width: 207px" data-options="label:'盘点时间',readonly:true"></input>
						
						</div>
						
						<div style="float:left;margin-left:20px;margin-top:-20px;">
							
							<input id="take-type" class="easyui-textbox" style="width: 200px" data-options="label:'盘点库房',readonly:true"></input>
						
						</div>
						
					</div>
					
					<div style="margin-left: 20px;margin-top:-45px;">
						
						<table id="takestocktbxq-dg" class="logininform-table easyui-datagrid" style="width: 1020px; height: 250px"
							data-options="toolbar:'#logininform-tb',fitColumns:false,singleSelect:false">
							
						</table>
					
					</div>
					
					<div style="margin-left: 20px;height:30px;margin-right: 20px;margin-top:10px;">
					
						<span>盘点金额合计：</span><input id="take-pdje" class="easyui-textbox" style="width: 110px" data-options="readonly:true"/>
						
						<span>金额差合计：</span><input id="take-jec" class="easyui-textbox" style="width: 110px" data-options="readonly:true"/>
					
						<span style="margin-left: 220px">盘点库存总数量：</span><input id="take-pdzsl" class="easyui-textbox" style="width: 110px" data-options="readonly:true"/>
					
						<span>盘点数量差合计：</span><input id="take-pdslc" class="easyui-textbox" style="width: 110px" data-options="readonly:true"/>
					
					</div>
					
					<div style="margin-left: 20px;height:30px;margin-right: 20px;margin-top:10px;">
						
						<span>摘要（M）：</span><input id="take-zy" class="easyui-textbox" style="width: 943px"/>
					
					</div>
					
					<div style="margin-left: 20px;height:30px;margin-right: 20px;margin-top:10px;">
						
						<span>填制人：</span><input id="take-tzr" class="easyui-textbox" style="width: 120px" data-options="readonly:true"/>
						
						<span>填制日期：</span><input id="take-tzrq" class="easyui-textbox" style="width: 125px" data-options="readonly:true"/>
						
						<span style="margin-left: 295px">审核人：</span><input id="take-shr" class="easyui-textbox" style="width: 120px"/>
						
						<span>审核日期：</span><input id="take-shrq" class="easyui-textbox" style="width: 120px"/>
					
					</div>
					
					<p style="margin-left: 250px;">
						
						<a id="save-takestocktbd" class="easyui-linkbutton" iconCls="icon-ok" style="width:250px;">确认</a> 
						
						<span style="margin-left: 50px;"></span>
						
						<a id="cancel-takestocktb" class="easyui-linkbutton" iconCls="icon-cancel" style="width:250px;">取消</a>
					
					</p>
				
				</div>
			
			</div>
		
		</div>
		
		<!-- 盘点记录详情表窗口 -->
		<div id="takestocktbjl-win" class="easyui-window" title="药品盘点详情表" style="width: 1075px; height: 598px"
			data-options="iconCls:'icon-save',modal:true,closed:true,shadow:true,resizable:false,collapsible:false,minimizable:false,maximizable:false">
			
			<div class="easyui-layout" data-options="fit:true">
				
				<div data-options="region:'center'">
					
					<div style="width: 1040px; height: 120px;">
						
						<h1 style="text-align:center;font-family:华文楷体;font-size : 30px;">第一医院药品盘点记录表</h1>
						
						<div  style="float:right;margin-right:0px;margin-top:-60px;">
							
							<input id="take-nos" class="easyui-textbox" style="width: 200px" data-options="label:'NO.',readonly:true"></input>
							
							<br><br>
							
							<input id="take-dates" class="easyui-textbox" style="width: 207px" data-options="label:'盘点时间',readonly:true"></input>
						
						</div>
						
						<div style="float:left;margin-left:20px;margin-top:-20px;">
							
							<input id="take-types" class="easyui-textbox" style="width: 200px" data-options="label:'盘点库房',readonly:true"></input>
						
						</div>
						
					</div>
					
					<div style="margin-left: 20px;margin-top:-45px;">
						
						<table id="takestocktb-dg" class="logininform-table easyui-datagrid" style="width: 1020px; height: 308px"
							data-options="toolbar:'#logininform-tb',fitColumns:false,singleSelect:false">
						
						</table>
					
					</div>
					
					<div style="margin-left: 20px;height:30px;margin-top:10px;">
					
						<span>盘点金额合计：</span><input id="take-zjes" class="easyui-textbox" style="width: 110px" data-options="readonly:true"/>
						
						<span>金额差合计：	 </span><input id="take-jecs" class="easyui-textbox" style="width: 110px" data-options="readonly:true"/>						
												
						<span style="margin-left: 220px">盘点库存总数量：</span><input id="take-zsl" class="easyui-textbox" style="width: 110px" data-options="readonly:true"/>
					
						<span>盘点数量差合计：</span><input id="take-slcs" class="easyui-textbox" style="width: 110px" data-options="readonly:true"/>
						
					</div>
					
					<div style="margin-left: 20px;height:30px;margin-top:10px;">
						
						<span>摘要（M）：</span><input id="take-zys" class="easyui-textbox" style="width: 943px" data-options="readonly:true"/>
					
					</div>
					
					<div style="margin-left: 20px;height:30px;margin-top:10px;">
						
						<span>填制人：</span><input id="take-tzrs" class="easyui-textbox" style="width: 120px" data-options="readonly:true"/>
						
						<span>填制日期：</span><input id="take-pdsjs" class="easyui-textbox" style="width: 125px" data-options="readonly:true"/>
						
						<span style="margin-left: 310px">审核人：</span><input id="take-shrs" class="easyui-textbox" style="width: 120px" data-options="readonly:true"/>
						
						<span>审核日期：</span><input id="take-shsjs" class="easyui-textbox" style="width: 120px" data-options="readonly:true"/>
					
					</div>
				
				</div>
			
			</div>
		
		</div>

	</div>
	
	<input type="hidden" value="${user.userName}"  id="outboundPeople">
	
	<!-- 弹框提示 -->
	<div id="DRUGONEe" class="easyui-window"  title="提示框" style="width:300px;height:156px"
	    data-options="iconCls:'icon-save',modal:true,resizable:false,collapsible:false,maximizable:false,minimizable:false,closed:true">
	          <p class="drugonee" style="text-align:center;font-size: 16px;margin-top: 47px;">
	          </p>
	</div> 

</body>
</html>